import Vue from "vue";
import VueRouter from "../selfRouter";
// import Layout from "../layout/index.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/login",
    name: "Login",
    component: () => import(/* webpackChunkName: "login" */ "@/views/login.vue")
  },
  {
    path: "/",
    name: "Home",
    component: () =>
      import(/* webpackChunkName: "home" */ "../views/Home.vue")
  },
  {
    path: "/about",
    name: "About",
    props: true,
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/About.vue")
  },
  // {
  //   path: "/",
  //   name: "Layout",
  //   component: Layout,
  //   children: [
  //     {
  //       path: "",
  //       name: "Home",
  //       component: () =>
  //         import(/* webpackChunkName: "home" */ "../views/Home.vue")
  //     },
  //     {
  //       path: "/about/:id",
  //       name: "About",
  //       props: true,
  //       component: () =>
  //         import(/* webpackChunkName: "about" */ "../views/About.vue")
  //     }
  //   ]
  // },
  {
    path: "*",
    name: 404,
    component: () => import(/* webpackChunkName: "about" */ "../views/404.vue")
  }
  
];

const router = new VueRouter({
  mode: "hash",
  base: process.env.BASE_URL,
  routes
});

export default router;
